package com.h3c.nem.service;

import com.h3c.nem.dto.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.h3c.nem.dto.form.GetFormBusinessData;
import com.h3c.nem.entity.TbOfferWorker;
import com.h3c.nem.entity.TbWorker;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Copyright (C), 2020-2020, h3c
 * FileName: ITbWorkerService
 *
 * @Author: l22886
 * @Date: 2022-01-19
 * Description: tb_worker service
 * Version: 1.0
 */
public interface ITbWorkerService extends IService<TbWorker> {

    /**
     * @param dto
     * @title: selectFuzzyByDto
     * @description: 模糊查询操作
     * @params: [ dto ]
     * @return: java.util.List
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public List<TbWorkerDTO> selectFuzzyByDto(TbWorkerSeaDTO dto);

    public List<TbWorkerDTO> selectHelpRecord(TbWorkerDTO dto);

    /**
     * @title: selectByDto
     * @description: 精确查询操作
     * @params: [ dto ]
     * @return: java.util.List
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public List<TbWorkerDTO> selectByDto(TbWorkerDTO dto);

    /**
     * @title: insertDto
     * @description: 插入操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public Integer insertDto(TbWorkerDTO dto);

    /**
     * @title: updateDto
     * @description: 修改操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public Integer updateDto(TbWorkerDTO dto);

    /**
     * @title: deleteDto
     * @description: 删除操作
     * @params: [ dto ]
     * @return: Integer
     * @createTime: 2022-01-19
     * @version: 1.0
     * @author: l22886
     */
    public Integer deleteDto(TbWorkerDTO dto);

    public TbWorkerDTO getBasicInfo(TbWorkerDTO dto);

    void startFirstMonthAssessment(List<String> workerIds);

    File exportWorkerList(TbWorkerSeaDTO paramsDTO);

    public Map<String, Object> getWxWorkerData(GetFormBusinessData getFormBusinessData);

    /**
     * 首页汇总信息
     *
     * @return
     */
    Map<String, Object> homePageChart();

    public TbInstNodeDTO getWorkerFlowNodes(TbWorkerDTO dto);

    void syncAllWorker();


    String syncNewWorker(String time);

    void syncNewWorkerGrade();

    /**
     * 同步但不发送
     *
     * @param time
     */
    void syncNewWorker1(String time);

    void importWorkerList(MultipartFile file);

    void endAssessment(List<TbWorkerDTO> paramsDTOS);

    List<Map<String, Object>> get2WePassedWorkerList(Date startTime,
                                                     Date endTime,
                                                     Set<Integer> deptIdList,
                                                     boolean isMore18,
                                                     String conId);

    void sendRegularNotice(SdEmailTemplateDTO emailTemplateDTO);

    /**
     * 把offerWorker插入到tbWorker并发送代办和邮件
     *
     * @param offerWorker
     */
    void insertOfferWorkerIntoWorker(TbOfferWorker offerWorker);

    void syncWorkerByHrss();

    /**
     * 根据deptContactor更新worker上的接口人信息
     * 如果接口人有变动 返回接口人信息 && 更新待办
     * 没有变动返回null
     *
     * @param dbWorker
     * @param deptContactor
     * @param workerId
     * @return
     */
    String isChangeDeptCon(TbWorker dbWorker, String deptContactor);

    public void createCreateSpecificFlowInstS();

    /**
     * 获取卡证制卡人员信息
     *
     * @Param: dto 实体查询参数信息
     * @Author: h24002
     * @Date: 2022/6/24
     */
    List<TbWorkerCardDTO> getWorkerCardListByDto(TbWorkerCardQueryDTO dto);

    /**
     * 导出卡证制卡人员信息--Excel导出
     *
     * @Param: dto 查询参数（无分页）
     * @Param: templateCode 模板编码
     * @Param: downLoadFileName 要下载的文件名称
     * @Author: h24002
     * @Date: 2022/6/27
     */
    File exportWorkerCardListByDto(TbWorkerCardQueryDTO dto, String templateCode, String downLoadFileName);

    /**
     * 获取工卡照片人员信息
     *
     * @Param: dto 实体查询参数信息
     * @Author: h24002
     * @Date: 2022/6/24
     */
    List<TbWorkerCardImageDTO> getWorkerCardImageListByDto(TbWorkerCardQueryDTO dto);

    /**
     * 导出人员工卡照片压缩包
     *
     * @Param: imgList 要导出的员工信息（需包含链接，sfs文件ID）
     * @Param: dto 实体查询参数信息
     * @Author: h24002
     * @Date: 2022/6/24
     */
    Map<String, Object> exportWorkerCardImageArrayByDto(List<TbWorkerCardImageDTO> imgList,TbWorkerCardQueryDTO dto);

    /**
     * 每月1日或15日定时任务给接口人邮件推送转正日期在下半个月或下月的上半个月的新员工名单给接口人；邮件中需包含转正名单附件；
     */
    void sendRegularWorkerToContact();

    void finishDeclare(List<Integer> workerIds);

    void checkFinishWorker();

    void updateWorkerInfo();

    public void sendMailForContactorResign();

}
